//
//  ZGLTitleCollectionViewCell.m
//  Faker
//
//  Created by dllo on 15/11/4.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import "ZGLTitleCollectionViewCell.h"
#import <UIImageView+AFNetworking.h>

@interface ZGLTitleCollectionViewCell ()

@property (nonatomic, strong) UIImageView *titleImage;

@end


@implementation ZGLTitleCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        self.titleImage = [[UIImageView alloc] init];
        [self.contentView addSubview:self.titleImage];
    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes {
    [super applyLayoutAttributes:layoutAttributes];
    self.backgroundColor = foreColor;
    [self.titleImage setFrame:CGRectMake(0, 0, ScaleX * 375, ScaleX * 60)];
}
- (void)setTitleUrl:(NSString *)titleUrl {
    if (_titleUrl != titleUrl) {
        _titleUrl = titleUrl;
    }
    [self.titleImage setImageWithURL:[NSURL URLWithString:titleUrl] placeholderImage:[UIImage imageNamed:@"nopic"]];
}

@end
